package nl.foldervisualizer.business
{
	import mx.utils.StringUtil;
	
	public class FolderItem
	{
		public var path:String
		public var relativeSize:Number
		public var bytes:Number
						
		public function FolderItem(path:String, relativeSize:Number = 0, bytes:Number = 0):void {
			this.path = path
			this.relativeSize = relativeSize
			this.bytes = bytes
		}
		
		public function add(other:FolderItem):FolderItem {
			return new FolderItem(this.path, this.relativeSize + other.relativeSize, this.bytes + other.bytes)
		} 
		
		public function folderItemSort(item1:FolderItem, item2:FolderItem):int {
			if (item1.relativeSize < item2.relativeSize) {
				return -1
			}
			
			if (item1.relativeSize > item2.relativeSize) {
				return 1
			}
			
			return 0
		}
	}
}